Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add chainSpec_v1 group of functions #820

Merged
merged 2 commits into from
Sep 15, 2024

Conversation

voliva
Copy link
Contributor

@voliva voliva commented Sep 12, 2024

Last missing group of functions to provide support with papi, so this closes #801

I may need help with the genesisHash function - I thought this would be available on the chain object directly, but it's not.

I called getBlockHash(0), which seems to get the job done, it seems to work when starting from genesis and from a wsUrl, but the types say it might return null. I couldn't find any case where this happens, but I'm also not sure what to do in this case.... any ideas?

@xlc
Copy link
Member

xlc commented Sep 12, 2024

You can call getBlockHash with a future block number and it will return null, however, for genesis, it should always give you a block hash. It will be an unreachable code path for the null case. You could throw error like "Unexpected null genesis" if it ever happens.

@xlc xlc merged commit e244e91 into AcalaNetwork:master Sep 15, 2024
6 checks passed
@voliva voliva deleted the chainSpec_v1 branch September 16, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chopsticks client is not compatible with Papi
2 participants